    {include file="../view/head" /}
    <style>
    /*页面自定义样式*/
    </style>
    </head>
    <body>
        {include file="../view/header" /}
        {include file="../view/sidebar" /}
        {include file="../view/right-sidebar" /}
        <!-- Start #content -->
        <div id="content">
            <!-- Start .content-wrapper -->
            <div class="content-wrapper">
                <div class="row">
                    <!-- Start .row -->
                    <!-- Start .page-header -->
                    <div class="col-lg-12 heading hidden-xs hidden-sm">
                        <!-- Start .bredcrumb -->
                        <ul id="crumb" class="breadcrumb"></ul>
                        <!-- End .breadcrumb -->
                    </div>
                    <!-- End .page-header -->
                </div>
                <!-- End .row -->
                <div class="outlet">
                    <!-- Start .outlet -->
                    <!-- Page start here ( usual with .row ) -->
                    <div class="row">
                        <div class="col-lg-12">
                            <!-- Start col-lg-12 -->
                            <div class="panel panel-default toggle panelRefresh">
                                <!-- Start .panel -->
                                <div class="panel-heading" style="padding: 10px 15px 0 15px;">
                                    <h3 class="panel-title">
                                        <i class="fa-stackexchange"></i>系统充值
                                    </h3>
                                    <div class="col-md-3 col-sm-4 col-xs-6">
                                        <div class="input-group">
                                            <span class="input-group-addon">矿机价格</span>
                                            <input type="number" id="auto1" class="form-control" placeholder="自动计算" value="2000" onkeyup="autoinput();">
                                        </div>
                                    </div>
                                    <div class="col-md-3 col-sm-4 col-xs-6">
                                        <div class="input-group">
                                            <span class="input-group-addon">矿机数量</span>
                                            <input type="number" id="auto2" class="form-control" placeholder="自动计算" onkeyup="autoinput();">
                                        </div>
                                    </div>
                                </div>
                                <div class="panel-body">
                                    <form class="form-horizontal group-border hover-stripped" method="post" action="#" onsubmit="if(!confirm('不可撤销，继续充值？'))return false;">
                                        {:token()}
                                        <div class="form-group">
                                            <div class="col-md-12 col-sm-12 col-xs-12 mb5">
                                                <div class="alert alert-danger m0" style="padding: 6px 12px;">
                                                    OME充值均为不可提链OME，不充值的币种留空即可，要扣款输入负数即可（如 -100）。
                                                </div>
                                            </div>
                                            <div class="col-md-6 col-sm-12 col-xs-12 mb5">
                                                <div class="input-group">
                                                    <span class="input-group-addon">充值账号</span>
                                                    <input type="number" class="form-control" name="uname" placeholder="输入用户账号(手机号)" value="{$uname}">
                                                    <span class="input-group-btn">
                                                        <button class="btn btn-info" type="button" onclick="chick_user()"><i class="ec-search"></i> 检查</button>
                                                    </span>
                                                </div>
                                            </div>
                                            <div class="col-md-6 col-sm-12 col-xs-12 mb5">
                                                <div class="alert alert-info m0" style="padding: 6px 12px;" id="userinfo">
                                                    (检查结果)
                                                </div>
                                            </div>
                                            <div class="col-md-6 col-sm-12 col-xs-12 mb5">
                                                <div class="input-group">
                                                    <span class="input-group-addon">充值OME数量</span>
                                                    <input type="number" class="form-control" name="ome" placeholder="不充不要填">
                                                </div>
                                            </div>
                                            <div class="col-md-6 col-sm-12 col-xs-12 mb5">
                                                <div class="input-group">
                                                    <span class="input-group-addon">充值矿金数量</span>
                                                    <input type="number" class="form-control" name="kuang" placeholder="不充不要填">
                                                </div>
                                            </div>
                                            <div class="col-md-6 col-sm-12 col-xs-12 mb5">
                                                <div class="input-group">
                                                    <span class="input-group-addon">充值M币数量</span>
                                                    <input type="number" class="form-control" name="quan" placeholder="不充不要填">
                                                </div>
                                            </div>
                                            <div class="col-md-6 col-sm-12 col-xs-12 mb5">
                                                <div class="input-group">
                                                    <span class="input-group-addon">备注信息</span>
                                                    <input type="text" class="form-control" name="note" value="系统充值">
                                                </div>
                                            </div>
                                            <div class="col-md-12 col-sm-12 col-xs-12 mb5">
                                                <input type="submit" class="btn btn-info btn-block" value="确定充值">
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                            <div class="panel panel-default toggle panelRefresh">
                                <!-- Start .panel -->
                                <div class="panel-heading">
                                    <h3 class="panel-title"><i class="fa-list"></i>OME·充值记录</h3>
                                </div>
                                <div class="panel-body">
                                    <table class="table table-bordered table-hover table-striped">
                                        <thead>
                                            <tr>
                                                <th>用户名</th>
                                                <th>充值额度</th>
                                                <th>充值后余额</th>
                                                <th>充值时间</th>
                                                <th>备注</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        {foreach $lists_ome as $list} 
                                            <tr>
                                                <td>{$list.uname}</td>
                                                <td>{$list.money}</td>
                                                <td>{$list.mhou}</td>
                                                <td>{$list.time|date='Y-m-d H:i:s',###}</td>
                                                <td>{$list.note}</td>
                                            </tr>
                                        {/foreach}
                                        </tbody>
                                        <tfoot>
                                            <tr>
                                                <th>用户名</th>
                                                <th>充值额度</th>
                                                <th>充值后余额</th>
                                                <th>充值时间</th>
                                                <th>备注</th>
                                            </tr>
                                        </tfoot>
                                    </table>
                                    <div class="row">
                                        <div class="col-md-6">
                                            {$lists_ome->render()}
                                        </div>
                                        <div class="col-md-6">
                                            <p>总数：{$lists_ome->total()}</p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="panel panel-default toggle panelRefresh">
                                <!-- Start .panel -->
                                <div class="panel-heading">
                                    <h3 class="panel-title"><i class="fa-list"></i>矿金·充值记录</h3>
                                </div>
                                <div class="panel-body">
                                    <table class="table table-bordered table-hover table-striped">
                                        <thead>
                                            <tr>
                                                <th>用户名</th>
                                                <th>充值额度</th>
                                                <th>充值后余额</th>
                                                <th>充值时间</th>
                                                <th>备注</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        {foreach $lists_kuang as $list} 
                                            <tr>
                                                <td>{$list.uname}</td>
                                                <td>{$list.money}</td>
                                                <td>{$list.mhou}</td>
                                                <td>{$list.time|date='Y-m-d H:i:s',###}</td>
                                                <td>{$list.note}</td>
                                            </tr>
                                        {/foreach}
                                        </tbody>
                                        <tfoot>
                                            <tr>
                                                <th>用户名</th>
                                                <th>充值额度</th>
                                                <th>充值后余额</th>
                                                <th>充值时间</th>
                                                <th>备注</th>
                                            </tr>
                                        </tfoot>
                                    </table>
                                    <div class="row">
                                        <div class="col-md-6">
                                            {$lists_kuang->render()}
                                        </div>
                                        <div class="col-md-6">
                                            <p>总数：{$lists_kuang->total()}</p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="panel panel-default toggle panelRefresh">
                                <!-- Start .panel -->
                                <div class="panel-heading">
                                    <h3 class="panel-title"><i class="fa-list"></i>M币·充值记录</h3>
                                </div>
                                <div class="panel-body">
                                    <table class="table table-bordered table-hover table-striped">
                                        <thead>
                                            <tr>
                                                <th>用户名</th>
                                                <th>充值额度</th>
                                                <th>充值后余额</th>
                                                <th>充值时间</th>
                                                <th>备注</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        {foreach $lists_quan as $list} 
                                            <tr>
                                                <td>{$list.uname}</td>
                                                <td>{$list.money}</td>
                                                <td>{$list.mhou}</td>
                                                <td>{$list.time|date='Y-m-d H:i:s',###}</td>
                                                <td>{$list.note}</td>
                                            </tr>
                                        {/foreach}
                                        </tbody>
                                        <tfoot>
                                            <tr>
                                                <th>用户名</th>
                                                <th>充值额度</th>
                                                <th>充值后余额</th>
                                                <th>充值时间</th>
                                                <th>备注</th>
                                            </tr>
                                        </tfoot>
                                    </table>
                                    <div class="row">
                                        <div class="col-md-6">
                                            {$lists_quan->render()}
                                        </div>
                                        <div class="col-md-6">
                                            <p>总数：{$lists_quan->total()}</p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- Page End here -->
                </div>
                <!-- End .outlet -->
            </div>
            <!-- End .content-wrapper -->
            <div class="clearfix"></div>
        </div>
        <!-- End #content -->
        {include file="../view/foot" /}
        <script>
        function chick_user() {
            uname = $('input[name="uname"]').val();
            console.log(uname);
            $.post("{:url('users/ajax_userinfo')}",{"uname":uname},function(data){
                console.log(data);
                msg = '';
                if(data.zt==1){
                    msg = '用户'+uname+'余额：'+data.userinfo.ome+' OME，'+data.userinfo.kuang+' 矿金，'+data.userinfo.quan+' M币';
                }else{
                    msg = data.msg;
                }
                $('#userinfo').text(msg);
            }, "json");
        }
        function autoinput() {
            var all = $('#auto1').val()*$('#auto2').val()/100;
            $('input[name="ome"]').val(all*{$setting.shopkj_price_ome});
            $('input[name="kuang"]').val(all*{$setting.shopkj_price_kuang});
            $('input[name="quan"]').val(all*{$setting.shopkj_price_quan});
        }
        </script>
    </body>
</html>